ci: забрани Co-Authored-By към агент, запази трейлърите с хора - #296
Merged
Conversation
Правилото в AGENTS.md се четеше като пълна забрана на `Co-Authored-By:`, а буквалното му спазване би изтрило заслугата на сътрудниците: при squash GitHub съставя трейлърите от авторите на коммитите в PR-а и те са единственото, което държи външния автор в историята - авторът на самия squash коммит винаги е този, който е отворил PR-а. 22 от 376 коммита на main ги носят, включително тези, които пазят заслугата на StanislavBG, Румен и Йоан. Забраненото е друго: трейлър, който кредитира агент - Claude Code, Codex, Cursor, Copilot. Те са инструменти, не сътрудници. Проверката ги лови на ниво PR и казва как се оправя, без да праща никого да пренаписва чужд форк. Тестовете карат проверката срещу истинска история: човешки съавтор и dependabot не се маркират, а трейлърът на Cursor в PR #118 се маркира. Пътьом: post-create.sh предупреждава при самоличност като `t@e.com` или `...MacBook-Pro.local`. И двете вече са влизали в публичната история точно по този път.
Test coverage
✅ No workspace dropped below its baseline (tolerance 0.5pp). 📈 Coverage rose by more than 1pp — run |
Отделната работа се вижда в списъка, но правилото на main изисква само `check`. Значи червен кръст, който нищо не спира - точно класът „проверка, която изглежда, че пази". Стъпката вече е вътре в `check`, тъй че отказът е реален и не зависи от админска промяна по правилото.
midt-admin
approved these changes
Aug 9, 2026
This was referenced Aug 10, 2026
lyubomir-bozhinov
added a commit
to lyubomir-bozhinov/sigma
that referenced
this pull request
Aug 18, 2026
…ve, поименни връзки midt-bg#309) Third sync onto upstream/main (20 commits). Resolved four conflicts by union, keeping both sides' tests in every case: - apps/etl/src/eop.test.ts — our orchestration suite plus upstream's stream-cancel tests (midt-bg#284); the openBodyResponse helper moves under our import block. - apps/web/app/lib/conflicts.test.ts — our temporalLabel/timeline/authorityShares cases alongside upstream's registryEvidenceLabel wording tests (midt-bg#309). - packages/ingest/src/ocds.test.ts — union of the daysInWindow and fullDeriveIsSafe imports. - coverage-baseline.json — ours; every floor is strictly higher than upstream's. No coverage floor was lowered. Two upstream changes moved coverage and were met with tests rather than a looser baseline: - refresh.test.ts asserts the drop order, which now carries the derive-step scratch table amendment_contract_resolve (midt-bg#306) as its last entry. - packages/db branch coverage fell below its floor on the new poименни-връзки and contract-detail code. Restored to 98.47% (floor 98.3) and lines to 100% with tests for: registry_role narrowing to the two rungs the card can render, the ordering-unit vs authority fold, personSlug on a prefix-less key, getDb as the read-only chokepoint, and assertReadOnlyExec's empty-statement refusal. Also fixes a stale fixture in search.test.ts: the свързани-лица probe returned n:1 while the source requires n===2, so the "table present" mode silently exercised the un-migrated fallback and the conflict-aware hits SQL was never run. The fixture now reports the real count, with tests for the partial-migration and no-row cases and for a group whose count and hits disagree. apps/web regained its floor with tests for the conflict pages' cache headers and the methodology page's indexability, the confirmed-seal provenance line, a timeline with no declared-period band, and Pagination's disabled end-of-range state. Every new test was mutation-verified: the production line it covers was broken and the test confirmed failing. HITL-ACK: agent-instructions-self-mod AGENTS.md arrives from upstream (midt-bg#296/midt-bg#297, the Co-Authored-By trailer rule), not authored here — a merge cannot omit it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Излиза от наблюдение, че правилото ни е формулирано така, че спазено буквално вреди.
Какво не е наред с текста днес
AGENTS.mdказва „Never includeCo-Authored-By:trailers", шаблонът за PR го повтаря. Но:mainги носят, и ги слага GitHub при squash, не ние;Co-authored-by: Bilkoе причината @StanislavBG да е контрибутор след fix(etl): detect wrangler's SQLITE errors from stdout in safeD1 #277; същото важи за @B353N и @ydimitrof;Какво всъщност се има предвид
Да не кредитираме агент: Claude Code, Codex, Cursor, Copilot. Те са инструменти, които караме, не сътрудници.
Този PR го записва така и го прави проверимо.
Проверката
scripts/check-agent-trailers.mjsминава коммитите в PR-а и вали само при трейлър, сочещ агент.Стъпка на
check, не отделна работа - и това е нарочно. Правилото наmainизисква един-единствен статус,check. Отделна работа щеше да показва червен кръст, който нищо не спира, докато някой с админ права не я добави в правилото. Тоест щеше да е точно това, срещу което се борим: проверка, която изглежда, че пази. Вътре вcheckотказът е реален от първия ден.Изрично не маркира: хора и зависимости-ботове (dependabot, renovate) - техните трейлъри са как собствените им PR-и се приписват.
Съобщението при провал казва и как се оправя: този, който мърджва, реже редовете от squash съобщението (
gh pr merge --squash --body "..."). Форкът на сътрудника не се пипа - никакъв force push.Тестовете са срещу истинска история, не фикстури
8db751d(Co-authored-by: Bilko)0d9d0ad(dependabot)Co-authored-by: Cursor <cursoragent@cursor.com>Последният дърпа реалния реф на PR-а, вместо да пише фикстура, нагласена да пасне на израза.
Живият случай
PR #118 (@mhunter02) наистина носи трейлъра на Cursor в два коммита. Нищо не съм пипал по него. Когато се мърджва, редът се маха от squash съобщението - неговите коммити остават непокътнати.
Пътьом
post-create.shпредупреждава, когатоuser.emailе празен или изглежда като запълнител (t@e.com,...MacBook-Pro.local,localhost). И двете форми вече са влизали в публичната история по същия път - самоличност по подразбиране в контейнера ставаCo-authored-byред при squash. Скриптът само предупреждава; самоличността е на човека, не на скрипта.scripts/: 93 теста минават.